<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>进销存管理系统</title>
    <link href="{{ctx}}/imgs/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <link href="{{ctx}}/js/iceui/ui/ui.css" rel="stylesheet" type="text/css" />
    <link href="{{ctx}}/js/iceui/admin/iceLogin.css" rel="stylesheet" type="text/css" />
    <link href="{{ctx}}/js/captcha/css/verify.css" rel="stylesheet" type="text/css" />
    <script src="{{ctx}}/js/iceui/ice.js" type="text/javascript"></script>
    <script src="{{ctx}}/js/iceui/ui/ui.js" type="text/javascript"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.9.1/jquery.js" type="text/javascript"></script>
    <script src="{{ctx}}/js/captcha/js/crypto-js.js" type="text/javascript"></script>
    <script src="{{ctx}}/js/captcha/js/ase.js" type="text/javascript"></script>
    <script src="{{ctx}}/js/captcha/js/verify.js" type="text/javascript"></script>
</head>

<body style="background-image: url({{ctx}}/js/iceui/admin/img/bg.jpg);">
    <div id="forms" class="admin-login-box">
        <div class="admin-login-check">
            <svg class="logo-icon" viewBox="0 0 64 64">
                <path d="M1.3,5.8l31,53.7l31-53.7H1.3z M39.7,38.1L26,14.4h27.4L39.7,38.1z" fill="#FFF"></path>
            </svg>
            <svg class="logo-icons" viewBox="0 0 64 64">
                <path d="M1.3,5.8l31,53.7l31-53.7H1.3z" fill="#FFF"></path>
            </svg>
        </div>
        <div class="admin-login-form">
            <div class="admin-login-row">
                <div class="ripple"></div>
                <svg class="admin-login-icon name svg-icon" viewBox="0 0 20 20">
                    <path d="M0,20 a10,8 0 0,1 20,0z M10,0 a4,4 0 0,1 0,8 a4,4 0 0,1 0,-8"></path>
                </svg>
                <input type="text" name="username" rule="txt:账号;required" class="admin-login-input" placeholder="账号" />
            </div>
            <div class="admin-login-row">
                <svg class="admin-login-icon pass svg-icon" viewBox="0 0 20 20">
                    <path d="M0,20 20,20 20,8 0,8z M10,13 10,16z M4,8 a6,8 0 0,1 12,0"></path>
                </svg>
                <input type="password" name="password" rule="txt:密码;required" class="admin-login-input"
                    placeholder="密码" />
            </div>
            <button type="button" id="btn" onclick="submitForm()" class="admin-login-submit">登录</button>
            <div id="panel"></div>
        </div>
    </div>

    <script type="text/javascript">
        ice(function () {
            sessionStorage.removeItem('menus');
            sessionStorage.removeItem('selectId');
            sessionStorage.removeItem('sonId');
        });

        function submitForm() {
            if (iceui.validateForm('forms')) {
            	iceui.post('{{ctx}}/login.html', iceui.readForm('forms'), function (data) {
                    if (data.code == '20') {
                        location.href = '{{ctx}}/main.html';
                    } else if (data.code == '50') {
                        iceui.pop({title: data.msg, icon: 'warning'});
                    }
                });
                /* $('#panel').pointsVerify({
                    baseUrl: 'https://captcha.anji-plus.com/captcha-api',  //服务器请求地址, 默认地址为安吉服务器;
                    containerId: 'btn', // pop模式 必填 被点击之后出现行为验证码的元素id
                    mode: 'pop',
                    imgSize: {       //图片的大小对象
                        width: '400px',
                        height: '200px',
                    },
                    success: function(params) {
                        iceui.post('{{ctx}}/login.html', iceui.readForm('forms'), function (data) {
                            if (data.code == '20') {
                                location.href = '{{ctx}}/main.html';
                            } else if (data.code == '50') {
                                iceui.pop({title: data.msg, icon: 'warning'});
                            }
                        });
                    }
                }); */
            }
        }
    </script>
</body>

</html>